<include file='Common:header' />

<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">

	<!-- #section:basics/sidebar -->

	<include file='Common:left' />

	<!-- /section:basics/sidebar -->
	<div class="main-content">
		<div class="main-content-inner">
			<div class="page-content">



				<!--主题-->
				<div class="page-header">
					<h1>
						您当前操作
						<small>
							<i class="ace-icon fa fa-angle-double-right"></i>
							邮件设置
						</small>
					</h1>
				</div>

				<script>

					$(function(){
						$('#sys').ajaxForm({
							beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置
							success: complete, // 这是提交后的方法
							dataType: 'json'
						});

						function checkForm(){
							if( '' == $.trim($('#email_title').val())){
								layer.alert('发送邮件标题不能为空', {icon: 5}, function(index){
									layer.close(index);
									$('#email_title').focus();
								});
							}
						}
						function complete(data){
							if(data.status==1){
								layer.alert(data.info, {icon: 6}, function(index){
									layer.close(index);
									window.location.href="{:U('Sys/activesys')}";
								});
							}else{
								layer.alert(data.info, {icon: 5}, function(index){
								layer.close(index);
								//window.location.href="{:U('Sys/activesys')}";
								});
								return false;
							}
						}

					});
				</script>
				<div class="row">
					<div class="col-xs-12">
						<form class="form-horizontal" name="sys" id="sys" method="post" action="{:U('runactive')}">
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 是否开启邮箱激活： </label>
								<div class="col-sm-9" style="padding-top:5px;">
									<input name="options[email_active]" id="email_open" <if condition='$sys.email_active eq 1'>checked</if>  value="1" class="ace ace-switch ace-switch-4 btn-flat" type="checkbox" />
									<span class="lbl"></span>
								</div>
							</div>
							<div class="space-4"></div>

							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 邮件标题： </label>
								<div class="col-sm-9">
									<input type="text" name="options[email_title]" id="email_title" value="{$sys.email_title}"  class="col-xs-10 col-sm-5" />
											<span class="help-inline col-xs-12 col-sm-7">
												<span class="middle" id="restwo"></span>
											</span>
								</div>
							</div>
							<div class="space-4"></div>
							
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 模板内容： </label>
								<div class="col-sm-9">
									<script src="__PUBLIC__/ueditor/ueditor.config.js" type="text/javascript"></script>
									<script src="__PUBLIC__/ueditor/ueditor.all.js" type="text/javascript"></script>
									<textarea name="options[email_tpl]" rows="100%" style="width:100%" id="myEditor">{$sys.email_tpl}</textarea>
									<script type="text/javascript">
										var editor = new UE.ui.Editor();
										editor.render("myEditor");
									</script>
									<span style="color: #ffb752;">请用http://#link#代替激活链接，#username#代替用户名</span>
								</div>
							</div>
							<div class="space-4"></div>
							<div class="clearfix form-actions">
								<div class="col-sm-offset-3 col-sm-9">
									<button class="btn btn-info" type="submit">
										<i class="ace-icon fa fa-check bigger-110"></i>
										保存
									</button>

									&nbsp; &nbsp; &nbsp;
									<button class="btn" type="reset">
										<i class="ace-icon fa fa-undo bigger-110"></i>
										重置
									</button>
								</div>
							</div>
						</form>
					</div>
					</div>
				</div>
				<!-- <div class="hr hr-24"></div> -->

				<include file='Common:header_nav' />

			</div><!-- /.page-content -->
		</div>
	</div><!-- /.main-content -->


	<include file='Common:footer' />


	</body>
	</html>
